#include <opencv4/opencv2/opencv.hpp>
#include <iostream>


using namespace cv;
using namespace std;

int main(int argc, char** argv)
{
	Mat dst;
	Mat src = imread("031GP5-36-5E0.jpg", IMREAD_UNCHANGED);

	if (src.empty())
	{
		printf("cannot open image\n");

		return -1;
	}

	namedWindow("Image Show", WINDOW_AUTOSIZE);

	

	cout << "src.rows" << src.rows << endl;
	cout << "src.cols" << src.cols << endl;


	if (src.rows > src.cols)
	{
		rotate(src, dst, ROTATE_90_CLOCKWISE);
		imshow("Image Show", dst);
	}
	else 
	{
		imshow("Image Show", src);
	}




#if 0
	namedWindow("Output Show", WINDOW_AUTOSIZE);
	Mat output_image;

	cvtColor(src, output_image, COLOR_BGR2GRAY);
	imshow("Output Show",output_image);

	namedWindow("Output Show2", WINDOW_AUTOSIZE);
	Mat output_image2;

	cvtColor(src, output_image2, COLOR_BGR2YUV);
	imshow("Output Show2", output_image2);


	imwrite("D:\\OpenCV\\image\\01_save.jpg", output_image);
	imwrite("D:\\OpenCV\\image\\01_save.png", output_image);

#endif

	waitKey(0);
}